﻿using System;
#if DEBUG
using System.Diagnostics;
#endif // #if DEBUG
using System.Net;
using System.Xml;
using System.Collections.Generic;

using FRL.DebtChased.Extensions;

#if WORKFLOWEDITOR
using FRL.DebtChased.WorkflowEditor;
#endif //

#if REPOSITORY
using FRL.DebtChased.Repository;
#endif // #if REPOSITORY

namespace FRL.DebtChased.WorkflowObjects
{

	/// <summary>
	/// Declaration of WorkflowAction_Manual class
	/// The workflow action for allowing the collector to do what they like
	/// </summary>
	public class WorkflowAction_Manual : WorkflowAction_Base
	{

		/////////////////////////////////////////////////////////////
		// Enumerations

		// Different types of manual operation
		public enum eType
		{
			NotSet = 0x00,
			CollectorUnrestricted,
		}

		/////////////////////////////////////////////////////////////
		// Constants

		public const string XmlElementName = "WorkflowAction_Manual";
		public const string BoingLabel = "Manual";

		/////////////////////////////////////////////////////////////
		// Attributes

		private eType m_Type = eType.NotSet;
		public eType Type
		{
			get { return m_Type; }
			set { m_Type = value; }
		}

		/////////////////////////////////////////////////////////////
		// Construction

		public WorkflowAction_Manual()
		{

			// Initialize member variables
			base.Priority = ePriority.Automated;

		}

		/////////////////////////////////////////////////////////////
		// Implementation

		protected override string _getElementName()
		{
			return XmlElementName;
		}

#if WORKFLOWEDITOR
		public override string GetBoingLabel()
		{
			return BoingLabel;
		}
#endif // #if WORKFLOWEDITOR

#if WORKFLOWEDITOR
		public override string[] GetBoingSubStrings()
		{

			// Declare return variable
			string[] Ftmp = new string[2];

			// Set strings
			Ftmp[0] = "Manual";
			Ftmp[1] = m_Type.ToString();

			// Return variable
			return Ftmp;

		}
#endif // #if WORKFLOWEDITOR

		protected override void _writeParameters(XmlWriter w)
		{

			// Write members as parameters
			w.WriteAttributeString("type", ((int)m_Type).ToString());

		}

		protected override void _readParameters(XmlReader r)
		{

			// Read parameters
			m_Type = (eType)r.SafeReadIntAttribute("type", (int)eType.NotSet);

		}

		public override string GetSummary(Workflow.eSummaryFormat SummaryFormat)
		{

			// Declare return variable
			string strFtmp = null;

			// Compare formats
			if (SummaryFormat == Workflow.eSummaryFormat.Audit)
			{
				strFtmp = "Manual";
			}
			else if (SummaryFormat == Workflow.eSummaryFormat.Clockwork)
			{
				strFtmp = "Manual";
			}
#if DEBUG
			else
				Debug.Assert(false);
#endif // #if DEBUG

			// Return variable
			return strFtmp;

		}

#if REPOSITORY
		public override List<AccountNote> Process(DebtChasedEntities ent, Account acc, AccountInvoice inv)
		{

			// Declare return variable
			List<AccountNote> Ftmp = null;

			// Return variable
			return Ftmp;

		}
#endif // #if REPOSITORY

	}

}
